Add Wikipedia Library survey for active TWL users#1497
Merged
katydidnot merged 5 commits intomasterfrom Dec 5, 2025
Merged
Conversation
c23e499 to
7c98608
Compare
7c98608 to
9ade6e8
Compare
Bug: T409420
9ade6e8 to
017c83c
Compare
Check wp account age at last login rather than current account age Bug: T409420
95cb78d to
4d3f3d4
Compare
- test eligible and ineligible users - wp account age at last login should be gte 182 days - remove migration from commit (will be committed by CI) Bug: T409420
34f0abd to
4923d30
Compare
"--staff_test" arg inverts is_staff to only email staff users who are otherwise eligible Bug: T409420
DHardy-WMF
requested changes
Dec 5, 2025
Contributor
DHardy-WMF
left a comment
There was a problem hiding this comment.
LGTM! Just one minor formatting issue to fix and I'll approve.
| ) | ||
|
|
||
| def handle(self, *args, **options): | ||
|
|
Contributor
There was a problem hiding this comment.
Black is complaining about this empty line. After I removed it locally, all the unit tests were successful.
katydidnot
approved these changes
Dec 5, 2025
Contributor
katydidnot
left a comment
There was a problem hiding this comment.
This looks great, and works as expected in my testing locally.
It does look like there's a minor formatting error to fix before I can merge.
ran `docker compose exec twlight /venv/bin/black -t py311 /app/TWLight` Bug: T409420
Member
Author
|
turns out different versions of black can have different results for the same target. My host version was different, so I ran |
DHardy-WMF
approved these changes
Dec 5, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug: T409420
Description
Add user survey email command, including:
Rationale
See parent task, T402650
Phabricator Ticket
T409420
How Has This Been Tested?
Added unit test, and did manual local testing
Local testing:
ran SQL queries against local data to spot check account age logic against raw data. Example:
(Note that this is a slightly loose selection)
edited
survey_active_usersto print equivalent info instead of sending message and updating accounts. Example:ran command, eg
python manage.py survey_active_users 000001 en fr de ja ru esand viewed output, spot checked info against db query results
Screenshots of your changes (if appropriate):
N/A
Types of changes
What types of changes does your code introduce? Add an
xin all the boxes that apply: